package com.yuexun.beilunpatient.ui.bodyCheck.model.impl;

import com.yuexun.beilunpatient.ui.bean.BaseListEntity;
import com.yuexun.beilunpatient.ui.bodyCheck.api.BodyCheckApi;
import com.yuexun.beilunpatient.ui.bodyCheck.bean.BodyCheckBasicBean;
import com.yuexun.beilunpatient.ui.bodyCheck.bean.BodyCheckHosBean;
import com.yuexun.beilunpatient.ui.bodyCheck.model.IBodyCheckModel;
import com.yuexun.beilunpatient.ui.consult.api.ArticleApi;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by Administrator on 2019/4/28 0028.
 */

public class BodyCheckModel implements IBodyCheckModel{
    private BodyCheckApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public BodyCheckApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(BodyCheckApi.class);
        }
    }

    @Override
    public Observable<BaseListEntity<BodyCheckHosBean>> inquireBodyTestList(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireBodyTestList(praise);
    }

    @Override
    public Observable<BaseListEntity<BodyCheckBasicBean>> inquireHomdeDocBodyTest(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireHomdeDocBodyTest(praise);
    }
}
